<template>
	<div class="zco-get-screen-shot-response-container">
		<p>{{ getMessage }}</p>
		<template v-if="status === 'done'">
			<p>截图图片：</p>
			<img :src="imageUrl" width="78" height="98" @click="preview" />
		</template>
		<template v-if="reason === 'auto-rejected'">
			<p>{{ getReason }}</p>
		</template>
	</div>
</template>
<script>
import zcoIMEvent from '@/store/event';
export default {
	name: 'APP',
	props: {
		toUserRole: {
			type: String,
			default: () => ''
		},
		toUserName: {
			type: String,
			default: () => ''
		},
		imageUrl: {
			type: String,
			default: () => ''
		},
		status: {
			type: String,
			default: () => ''
		},
		reason: {
			type: String,
			default: () => ''
		}
	},
	computed: {
		getMessage() {
			return `致 <${this.toUserRole === 'agent' ? '坐席' : '访客'}${this.toUserName}>，${this.status === 'done' ? '截图成功' : '截图失败'}`;
		},
		getReason() {
			return `原因：访客正在进行其他指令`;
		}
	},
	data() {
		return {};
	},
	methods: {
		preview() {
			zcoIMEvent.emitPreview({ type: 'png', url: this.imageUrl });
		}
	},
	created() {},
	mounted() {}
};
</script>
<style scoped>
.zco-get-screen-shot-response-container p {
	margin: 0;
}
.zco-get-screen-shot-response-container img {
	margin-top: 4px;
}
</style>
